import myAxios from './myAxios'

//登录接口
export const apiLogin = (account,pwd) => myAxios.post('/front/user/basic/login',{account,pwd})

//注册接口
export const apiRegister = (account,pwd) => myAxios.post('/front/user/basic/register',{account,pwd})

//创建单选投票
export const apiVoteRadio = (user_id,title,option) => myAxios.post('/vote/single_add',{user_id,title,option})

//创建多选投票
export const apiVoteCheckBox = (user_id,title,option) => myAxios.post('/vote/many_add',{user_id,title,option})


//修改密码
export const apiUpdatePwd = (pwd,pwdx,user_id) => myAxios.post('/front/user/extend/update_pwd',{pwd,pwdx,user_id})

//修改用户昵称
export const apiUpdateName = (user_id,name) => myAxios.post('/front/user/extend/update_name',{user_id,name})

//创建投票
export const apiCreateVote = (user_id,title,describe,option,type,anonymous,end_time) => myAxios.post('/front/vote/vote_add',{ user_id,describe,title,type,option,end_time,anonymous})

//编辑获取投票
export const apiEditVote = ( vote_id ) => myAxios.post('/front/vote/getVote_data',{vote_id})

//修改投票信息
export const apiUpdateVote = (vote_id,title,describe,start_time,end_time,type,option,delArr,anonymous) => myAxios.post('/front/vote/update_votedata',{vote_id,title,describe,start_time,end_time,type,option,delete:delArr,anonymous})

//获取投票详细信息
export const apiVoteDetail = ( vote_id ) => myAxios.post('/front/vote/getVoteDetailData',{vote_id})

//删除投票
export const apiDeleteVote = ( vote_id,user_id ) => myAxios.post('/front/vote/delete_vote',{vote_id,user_id})

//获取用户所有投票项
export const apiGetVoteAll = ( user_id ) => myAxios.post('/front/vote/getAllvote',{user_id})

//投票接口
export const apiToNoAnonymousVote = ( option_id,user_id,type ) => myAxios.post('/front/vote/no_anonymous_vote',{option_id,user_id,type})
export const apiToVote = ( option_id,user_id,type ) => myAxios.post('/front/vote/anonymous_vote',{option_id,user_id,type})

//判断是否已投票
export const apiIsToVote = ( vote_id,user_id ) => myAxios.post('/front/vote/istoVote',{vote_id,user_id})